/*
 * MOTOR.h
 *
 * Created: 29.10.2012 15:04:57
 *  Author: bardbakk
 */ 

/*!
 * @header		MOTOR.h
 * @discussion	This file contains all declarations for the motorbox
*/		

#ifndef MOTOR_H_
#define MOTOR_H_


/*!
 * @function	MOTOR_init
 * @discussion	Initializes the motorbox and calibrates the position encoder.
 * @result		None.
 */	
void MOTOR_init();


/*!
 * @function	MOTOR_set_speed
 * @discussion	Sets the motor speed and direction.
 * @param		val		The desired speed and direction, between -100 and 100.
 * @result		None.
 */	
void MOTOR_set_speed(int val);


/*!
 * @function	MOTOR_set_reference
 * @discussion	Sets the position reference we wish to reach.  
 * @param		val		The desired position
 * @result		None.
 */	
void MOTOR_set_reference(int val);


/*!
 * @function	MOTOR_update_input
 * @discussion	Controls the motor to the desired reference.
 * @param		dt		The time elapsed since last update.
 * @result		None.
 */	
void MOTOR_update_input(float dt);


#endif /* MOTOR_H_ */